// https://nuxt.com/docs/api/configuration/nuxt-config
import { SYSYTM_TITLE } from './config'
export default defineNuxtConfig({
  app: {
    head: {
      charset: 'utf-8',
      viewport: 'width=device-width, initial-scale=0.55',
      title: SYSYTM_TITLE,
      // 引入Coze SDK
      script: [
        {
          src: 'https://lf-cdn.coze.cn/obj/unpkg/flow-platform/chat-app-sdk/1.2.0-beta.5/libs/cn/index.js',
          defer: true
        }

      ],
      meta: [
        {
          name: "viewport",
          content: "width=device-width, initial-scale=0.55, user-scalable=no,shrink-to-fit=no,viewport-fit=cover",
        },
        {
          charset: "utf-8",
        },
      ],

    }
  },
  devServer: {
    host: '0.0.0.0',
    port: 80
  },
  ssr: true,
  runtimeConfig: {
    // public中的键也可以在客户端使用
    public: {
      apiBaseUrlPrefix: process.env.NUXT_API_BASE_URL_PREFIX,
      apiBaseUrl: process.env.NUXT_API_BASE_URL,
      apiFileUrl: process.env.NUXT_API_FILE_URL,
    }
  },
  compatibilityDate: '2024-04-03',
  devtools: { enabled: true },
  css: ["~/assets/css/main.less"],
  modules: ['@pinia/nuxt'],
  alias: {
    pinia: "/node_modules/@pinia/nuxt/node_modules/pinia/dist/pinia.mjs"
  },
  imports: {
    // dirs: ['apis/**']
  },
  nitro: {
    // 客户端渲染时
    devProxy: {
      "/dev-api": {
        // target: "http://119.91.227.162:8190", // 这里是测试接口地址
        target: "http://localhost:8190", // 这里是接口地址
        changeOrigin: true,
        prependPath: true,
      },
    },
  },
})
